#ifndef __CCUSTOM_EDIT_CONTROL_H__
#define __CCUSTOM_EDIT_CONTROL_H__

#include <gdiplus.h>
using namespace Gdiplus;

class CCustomEdit : public CEdit
{
	DECLARE_DYNAMIC(CCustomEdit)

//*************************************************************************************************//Class Function
public:
	CCustomEdit(void);
	~CCustomEdit(void);

	void Initialize(HWND hPParentWnd, HWND hParentWnd, HDC hBgDC, HDC hDrawDC, int nParentx = 0, int nParenty = 0);
	void SetString(const CString &str);
	void DrawUI();

private:
	void CreateFont();

//*************************************************************************************************//Class Parameters
public:
	int m_nLineInRect, m_nLineALL, m_nMovedLine;

private:
	//Text Parameter
	CString m_strText;
	int m_nFontSize, m_nFontStyle;
	Gdiplus::Unit m_enFontUnit;
	Gdiplus::StringFormat* m_strTextFormat;
	Gdiplus::FontFamily* m_pFontFamily;
	Gdiplus::SolidBrush* m_pFontBrush;
	Gdiplus::Font* m_pFont;

	//UI Rect Parameter
	CRect m_rtRect, m_rtPRect, m_rtPPRect;
	
	//Image and Handle Parameter
	HDC m_hBgDC, m_hDrawDC, m_hEditDC;
	HWND m_hPParentWnd, m_hParentWnd;
//*************************************************************************************************//Class Message
public:
	virtual void PreSubclassWindow();
	virtual void DrawItem(LPDRAWITEMSTRUCT /*lpDrawItemStruct*/);
	DECLARE_MESSAGE_MAP()
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
};
#endif
